//
//  CSL_mvMoreCell.m
//  HZ_Beautiful_Music
//
//  Created by dllo on 16/4/6.
//  Copyright © 2016年 ui. All rights reserved.
//

#import "CSL_mvMoreCell.h"
#import <UIImageView+WebCache.h>
@implementation CSL_mvMoreCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.timeLabel = [[UILabel alloc] initWithFrame:CGRectZero];
//        _timeLabel.backgroundColor = [UIColor redColor];
        _timeLabel.font = [UIFont systemFontOfSize:42];
        _timeLabel.textAlignment = NSTextAlignmentCenter;
        _timeLabel.textColor = [UIColor colorWithRed:1.000 green:0.289 blue:0.118 alpha:1.000];
        [self.contentView addSubview:_timeLabel];
        
        self.dividerView = [[UIView alloc] initWithFrame:CGRectZero];
        _dividerView.backgroundColor = [UIColor colorWithWhite:0.620 alpha:1.000];
        [self.contentView addSubview:_dividerView];
        
        self.mtimeLabel = [[UILabel alloc] initWithFrame:CGRectZero];
//        _mtimeLabel.backgroundColor = [UIColor redColor];
        _mtimeLabel.textColor = [UIColor colorWithWhite:0.774 alpha:1.000];
        _mtimeLabel.textAlignment = NSTextAlignmentCenter;
        _mtimeLabel.font = [UIFont systemFontOfSize:20];
        [self.contentView addSubview:_mtimeLabel];
        
        self.descLabel = [[UILabel alloc] initWithFrame:CGRectZero];
//        _descLabel.backgroundColor = [UIColor redColor];
        _descLabel.font = [UIFont systemFontOfSize:15];
        _descLabel.numberOfLines = 2;
        [self.contentView addSubview:_descLabel];
        
        self.firstLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _firstLabel.backgroundColor = [UIColor colorWithRed:arc4random()%150/255.0 green:arc4random()%150/255.0 blue:arc4random()%150/255.0 alpha:0.5];
        _firstLabel.textColor = [UIColor colorWithWhite:0.925 alpha:1.000];
        _firstLabel.font = [UIFont systemFontOfSize:15];
        _firstLabel.textAlignment = NSTextAlignmentCenter;
        //    设置圆角
        [_firstLabel.layer setCornerRadius:10];
        _firstLabel.layer.masksToBounds = YES;
        [self.contentView addSubview:_firstLabel];
        
        self.twoLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _twoLabel.backgroundColor = [UIColor colorWithRed:arc4random()%150/255.0 green:arc4random()%150/255.0 blue:arc4random()%150/255.0 alpha:0.5];
        _twoLabel.textColor = [UIColor colorWithWhite:0.925 alpha:1.000];
        _twoLabel.font = [UIFont systemFontOfSize:15];
        _twoLabel.textAlignment = NSTextAlignmentCenter;
        //    设置圆角
        [_twoLabel.layer setCornerRadius:10];
        _twoLabel.layer.masksToBounds = YES;
        [self.contentView addSubview:_twoLabel];
        
        
        self.threeLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _threeLabel.backgroundColor = [UIColor colorWithRed:arc4random()%150/255.0 green:arc4random()%150/255.0 blue:arc4random()%150/255.0 alpha:0.5];
        _threeLabel.textColor = [UIColor colorWithWhite:0.925 alpha:1.000];
        _threeLabel.font = [UIFont systemFontOfSize:15];
        _threeLabel.textAlignment = NSTextAlignmentCenter;
        //    设置圆角
        [_threeLabel.layer setCornerRadius:10];
        _threeLabel.layer.masksToBounds = YES;
        [self.contentView addSubview:_threeLabel];
        
        self.cImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        _cImageView.image = [[UIImage imageNamed:@"pinglun64"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//        _cImageView.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_cImageView];
        
        self.numberLabel = [[UILabel alloc] initWithFrame:CGRectZero];
//        _numberLabel.backgroundColor = [UIColor redColor];
        _numberLabel.font = [UIFont systemFontOfSize:15];
        _numberLabel.textColor = [UIColor colorWithWhite:0.648 alpha:1.000];
        [self.contentView addSubview:_numberLabel];
        
        self.dImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
//        _dImageView.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_dImageView];
        
        self.playImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        _playImageView.image = [[UIImage imageNamed:@"player64"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        [self.contentView addSubview:_playImageView];

        self.footView = [[UIView alloc] initWithFrame:CGRectZero];
        _footView.backgroundColor = [UIColor colorWithWhite:0.626 alpha:1.000];
        [self.contentView addSubview:_footView];
    }
    return self;
}

-(void)layoutSubviews {
    [super layoutSubviews];
    _timeLabel.frame = CGRectMake(self.bounds.size.width/25, self.bounds.size.height/20, self.bounds.size.width/7, self.bounds.size.height/8);
    _dividerView.frame =CGRectMake(self.bounds.size.width/25, self.bounds.size.height/5.9, self.bounds.size.width/7, 2);
    _mtimeLabel.frame = CGRectMake(self.bounds.size.width/25, self.bounds.size.height/5.7, self.bounds.size.width/7, self.bounds.size.height/8);
    _descLabel.frame = CGRectMake(self.bounds.size.width/5, self.bounds.size.height/20, self.bounds.size.width/1.4, self.bounds.size.height/8);
    _firstLabel.frame = CGRectMake(self.bounds.size.width/5, self.bounds.size.height/4.5, self.bounds.size.width/6, self.bounds.size.height/15);
    _twoLabel.frame = CGRectMake(self.bounds.size.width/2.5, self.bounds.size.height/4.5, self.bounds.size.width/6, self.bounds.size.height/15);
    _threeLabel.frame = CGRectMake(self.bounds.size.width/1.7, self.bounds.size.height/4.5, self.bounds.size.width/6, self.bounds.size.height/15);
    _cImageView.frame = CGRectMake(self.bounds.size.width/1.25, self.bounds.size.height/4.5, self.bounds.size.width/25, self.bounds.size.height/18);
    _numberLabel.frame = CGRectMake(self.bounds.size.width/1.17, self.bounds.size.height/4.5, self.bounds.size.width/12, self.bounds.size.height/18);
    _dImageView.frame = CGRectMake(self.bounds.size.width/25, self.bounds.size.height/3, self.bounds.size.width/1.08, self.bounds.size.height/1.6);
    _footView.frame = CGRectMake(0, self.bounds.size.height-1, self.bounds.size.width, 1);
    _playImageView.frame = CGRectMake(self.bounds.size.width/2.2, self.bounds.size.height/1.8, self.bounds.size.width/8, self.bounds.size.height/7);

}

- (void)setArray:(NSArray *)array {
    _array = array;
    CSL_Data_TagModel *modelone = array[0];
    _firstLabel.text = modelone.tagName;
    CSL_Data_TagModel *modeltwo = array[1];
    _twoLabel.text = modeltwo.tagName;
    CSL_Data_TagModel *modelthree = array[2];
    _threeLabel.text = modelthree.tagName;
}

-(void)setMvListArray:(NSArray *)mvListArray {
    _mvListArray = mvListArray;
    if (mvListArray.count > 0) {
    CSL_Data_MvListModel *mvListModel = mvListArray[0];
        [_dImageView sd_setImageWithURL:[NSURL URLWithString:mvListModel.picUrl] placeholderImage:[[UIImage imageNamed:@"11"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    }
}


@end
